*  This do file will replicate all models reported by Ura and Wohlfarth in 
*  "An Appeal to the People": Public Opinion and Congressional Support for the Supreme Court (Journal of Politics)
*  as well as estimates reported in supplementary documentation available at http://dvn.iq.harvard.edu/dvn/dv/jura.
*
*  Please direct correspondence to Joe Ura (joe.ura@gmail.com)
*
*
log using "C:\Documents and Settings\Ura\My Documents\My Dropbox\SC Institutionalization\Spring 2008\Final JOP\uw jop replication.smcl", replace 
*  note: Be sure to replace file path name with local location of dataset.
use "C:\Documents and Settings\Ura\My Documents\My Dropbox\SC Institutionalization\Spring 2008\Final JOP\uw jop replication.dta", clear 
*  note: Be sure to replace file path name with desired local location of log file to be generated.
*descriptive statistics
su factor_money conjudge_spline conlegis_spline courtcongideo alldocket
*long and short run estimates estimated via bardsen single-equation ecm
*base
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket, lag(1)
*original index
newey facindex facindex dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket, lag(1)
*presidency
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dconfed_spline lconfed_spline dcourtcongideo lcourtcongideo dcourtpresideo ///
lcourtpresideo dalldocket lalldocket, lag(1)
*only po
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline, lag(1)
*no dockect
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo, lag(1)
*no ideo
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dalldocket lalldocket, lag(1)
*linear interpolation
newey dfactor_money lfactor_money dconjudge lconjudge dconlegis lconlegis dcourtcongideo lcourtcongideo dalldocket lalldocket, lag(1)
*unadjusted standard errors
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket
*relative confidence
newey dfactor_money lfactor_money dconjudge_spline lconjudge_spline dcourtminusleg_spline lcourtminusleg_spline dcourtcongideo lcourtcongideo dalldocket lalldocket, lag(1)
*
*lrm estimates via bewely
*note: newey2 package must be installed from the web.
*base
newey2 factor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo dalldocket alldocket), lag(1)
*original index
newey2 dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo dalldocket alldocket ///
(dfacindex=lfacindex dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo dalldocket alldocket), lag(1)
*presidency
newey2 factor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dconfed_spline confed_spline /// 
dcourtcongideo courtcongideo dcourtpresideo courtpresideo dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dconfed_spline confed_spline ///
dcourtcongideo courtcongideo dcourtpresideo courtpresideo dalldocket alldocket), lag(1)
*only po
newey2 factor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline ///
(dfactor_money=lfactor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline), lag(1)
*no dockect
newey2 factor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo ///
(dfactor_money=lfactor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dcourtcongideo courtcongideo), lag(1)
*no ideo
newey2 factor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge_spline conjudge_spline dconlegis_spline conlegis_spline dalldocket alldocket), lag(1)
*linear interpolation
*note: code and data for reproducing estimates via mri for missing data are included in a separate do file available at http://dvn.iq.harvard.edu/dvn/dv/jura.
newey2 factor_money dconjudge conjudge dconlegis conlegis dcourtcongideo courtcongideo dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge conjudge dconlegis conlegis dcourtcongideo courtcongideo dalldocket alldocket), lag(1)
*unadjusted standard errors
ivreg factor_money dconjudge conjudge dconlegis conlegis dcourtcongideo courtcongideo dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge conjudge dconlegis conlegis dcourtcongideo courtcongideo dalldocket alldocket)
*relative confidence
newey2 factor_money dconjudge conjudge dcourtminusleg_spline courtminusleg_spline dcourtcongideo courtcongideo dalldocket alldocket ///
(dfactor_money=lfactor_money dconjudge conjudge dcourtminusleg_spline courtminusleg_spline dcourtcongideo courtcongideo dalldocket alldocket), lag(1)
*
*obtaining model diagnostics via stata's postregression suite
*base
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket
predict basemodelres, r
corr basemodelres l.basemodelres
bgodfrey
dfuller basemodelres
*original index
reg dfacindex lfacindex dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket
predict mcgmodelres, r
corr mcgmodelres l.mcgmodelres
bgodfrey
dfuller mcgmodelres
*presidency
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dconfed_spline lconfed_spline dcourtcongideo lcourtcongideo dcourtpresideo ///
lcourtpresideo dalldocket lalldocket
predict presmodelres, r
corr presmodelres l.presmodelres
bgodfrey 
dfuller presmodelres
*only po
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline
predict pomodelres, r
corr pomodelres l.pomodelres
bgodfrey
dfuller pomodelres
*no dockect
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo
predict nodocketmodelres, r
corr nodocketmodelres l.nodocketmodelres
bgodfrey 
dfuller pomodelres
*no ideo
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dalldocket lalldocket
predict noideomodelres, r
corr noideomodelres l.noideomodelres
bgodfrey
dfuller noideomodelres
*linear interpolation
*note: code and data for reproducing estimates via mri for missing data are included in a separate do file available at http://dvn.iq.harvard.edu/dvn/dv/jura.
reg dfactor_money lfactor_money dconjudge lconjudge dconlegis lconlegis dcourtcongideo lcourtcongideo dalldocket lalldocket
predict limodelres, r
corr limodelres l.limodelres
bgodfrey
dfuller limodelres
*unadjusted standard errors
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dconlegis_spline lconlegis_spline dcourtcongideo lcourtcongideo dalldocket lalldocket
predict olsmodelres, r
corr olsmodelres l.olsmodelres
bgodfrey
dfuller olsmodelres
*relative confidence
reg dfactor_money lfactor_money dconjudge_spline lconjudge_spline dcourtminusleg_spline lcourtminusleg_spline dcourtcongideo lcourtcongideo dalldocket lalldocket
predict relmodelres, r
corr relmodelres l.relmodelres
bgodfrey
dfuller relmodelres
*
log close



